home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / DOSSCAN.H < prev    next >
C/C++ Source or Header  |  1992-05-05  |  12KB  |  360 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/dos386/microcode/RCS/dosscan.h,v 1.1 1992/05/05 06:55:13 jinx Exp $
  4.  
  5. Copyright (c) 1992 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. /* Scan code conversion table for DOS */
  36.  
  37. #ifndef SCM_DOSSCAN_INCLUDE
  38. #define SCM_DOSSCAN_INCLUDE
  39.  
  40. #define Metafy(c)    ((unsigned char) (((unsigned char) (c))+128))
  41. /* This had better get uppercase characters */ 
  42. #define Controlify(c)    ((unsigned char) (((unsigned char) (c))-64))
  43.  
  44. #define NO_CONVERSION    ((unsigned char *) ((void *) 0))
  45.  
  46. unsigned char CTRL_AT[] = { '\0' };
  47. unsigned char META_a[] = {Metafy('a'), '\0'};
  48. unsigned char META_b[] = {Metafy('b'), '\0'};
  49. unsigned char META_c[] = {Metafy('c'), '\0'};
  50. unsigned char META_d[] = {Metafy('d'), '\0'};
  51. unsigned char META_e[] = {Metafy('e'), '\0'};
  52. unsigned char META_f[] = {Metafy('f'), '\0'};
  53. unsigned char META_g[] = {Metafy('g'), '\0'};
  54. unsigned char META_h[] = {Metafy('h'), '\0'};
  55. unsigned char META_i[] = {Metafy('i'), '\0'};
  56. unsigned char META_j[] = {Metafy('j'), '\0'};
  57. unsigned char META_k[] = {Metafy('k'), '\0'};
  58. unsigned char META_l[] = {Metafy('l'), '\0'};
  59. unsigned char META_m[] = {Metafy('m'), '\0'};
  60. unsigned char META_n[] = {Metafy('n'), '\0'};
  61. unsigned char META_o[] = {Metafy('o'), '\0'};
  62. unsigned char META_p[] = {Metafy('p'), '\0'};
  63. unsigned char META_q[] = {Metafy('q'), '\0'};
  64. unsigned char META_r[] = {Metafy('r'), '\0'};
  65. unsigned char META_s[] = {Metafy('s'), '\0'};
  66. unsigned char META_t[] = {Metafy('t'), '\0'};
  67. unsigned char META_u[] = {Metafy('u'), '\0'};
  68. unsigned char META_v[] = {Metafy('v'), '\0'};
  69. unsigned char META_w[] = {Metafy('w'), '\0'};
  70. unsigned char META_x[] = {Metafy('x'), '\0'};
  71. unsigned char META_y[] = {Metafy('y'), '\0'};
  72. unsigned char META_z[] = {Metafy('z'), '\0'};
  73. unsigned char META_1[] = {Metafy('1'), '\0'};
  74. unsigned char META_2[] = {Metafy('2'), '\0'};
  75. unsigned char META_3[] = {Metafy('3'), '\0'};
  76. unsigned char META_4[] = {Metafy('4'), '\0'};
  77. unsigned char META_5[] = {Metafy('5'), '\0'};
  78. unsigned char META_6[] = {Metafy('6'), '\0'};
  79. unsigned char META_7[] = {Metafy('7'), '\0'};
  80. unsigned char META_8[] = {Metafy('8'), '\0'};
  81. unsigned char META_9[] = {Metafy('9'), '\0'};
  82. unsigned char META_0[] = {Metafy('0'), '\0'};
  83. unsigned char META_DASH[] = {Metafy('-'), '\0'};
  84. unsigned char META_EQUAL[] = {Metafy('='), '\0'};
  85. unsigned char META_RET[] = {Metafy('\r'), '\0'};
  86. unsigned char META_TAB[] = {Metafy('\t'), '\0'};
  87. unsigned char META_LBROK[] = {Metafy('['), '\0'};
  88. unsigned char META_RBROK[] = {Metafy(']'), '\0'};
  89. unsigned char META_BACK[] = {Metafy('\\'), '\0'};
  90. unsigned char META_SEMI[] = {Metafy(';'), '\0'};
  91. unsigned char META_RQUOTE[] = {Metafy('\''), '\0'};
  92. unsigned char META_COMMA[] = {Metafy(','), '\0'};
  93. unsigned char META_DOT[] = {Metafy('.'), '\0'};
  94. unsigned char META_SLASH[] = {Metafy('/'), '\0'};
  95. unsigned char META_LQUOTE[] = {Metafy('`'), '\0'};
  96. unsigned char META_PLUS[] = {Metafy('+'), '\0'};
  97.  
  98. #define DEFAULT_SCANCODE_CONVERSIONS                \
  99. {                                \
  100. /* 0 */        NO_CONVERSION,                    \
  101. /* 1 */        NO_CONVERSION,                    \
  102. /* 2 */        NO_CONVERSION,                    \
  103. /* 3 */        CTRL_AT,                    \
  104. /* 4 */        NO_CONVERSION,                    \
  105. /* 5 */        NO_CONVERSION,                    \
  106. /* 6 */        NO_CONVERSION,                    \
  107. /* 7 */        NO_CONVERSION,                    \
  108. /* 8 */        NO_CONVERSION,                    \
  109. /* 9 */        NO_CONVERSION,                    \
  110. /* 10 */    NO_CONVERSION,                    \
  111. /* 11 */    NO_CONVERSION,                    \
  112. /* 12 */    NO_CONVERSION,                    \
  113. /* 13 */    NO_CONVERSION,                    \
  114. /* 14 */    NO_CONVERSION,                    \
  115. /* 15 */    NO_CONVERSION,                    \
  116. /* 16 */    META_q,                        \
  117. /* 17 */    META_w,                        \
  118. /* 18 */    META_e,                        \
  119. /* 19 */    META_r,                        \
  120. /* 20 */    META_t,                        \
  121. /* 21 */    META_y,                        \
  122. /* 22 */    META_u,                        \
  123. /* 23 */    META_i,                        \
  124. /* 24 */    META_o,                        \
  125. /* 25 */    META_p,                        \
  126. /* 26 */    META_LBROK,                    \
  127. /* 27 */    META_RBROK,                    \
  128. /* 28 */    META_RET,                    \
  129. /* 29 */    NO_CONVERSION,                    \
  130. /* 30 */    META_a,                        \
  131. /* 31 */    META_s,                        \
  132. /* 32 */    META_d,                        \
  133. /* 33 */    META_f,                        \
  134. /* 34 */    META_g,                        \
  135. /* 35 */    META_h,                        \
  136. /* 36 */    META_j,                        \
  137. /* 37 */    META_k,                        \
  138. /* 38 */    META_l,                        \
  139. /* 39 */    META_SEMI,                    \
  140. /* 40 */    META_RQUOTE,                    \
  141. /* 41 */    META_LQUOTE,                    \
  142. /* 42 */    NO_CONVERSION,                    \
  143. /* 43 */    META_BACK,                    \
  144. /* 44 */    META_z,                        \
  145. /* 45 */    META_x,                        \
  146. /* 46 */    META_c,                        \
  147. /* 47 */    META_v,                        \
  148. /* 48 */    META_b,                        \
  149. /* 49 */    META_n,                        \
  150. /* 50 */    META_m,                        \
  151. /* 51 */    META_COMMA,                    \
  152. /* 52 */    META_DOT,                    \
  153. /* 53 */    META_SLASH,                    \
  154. /* 54 */    NO_CONVERSION,                    \
  155. /* 55 */    META_PLUS,                    \
  156. /* 56 */    NO_CONVERSION,                    \
  157. /* 57 */    NO_CONVERSION,                    \
  158. /* 58 */    NO_CONVERSION,                    \
  159. /* 59 */    "(proceed)\r",                    \
  160. /* 60 */    NO_CONVERSION,                    \
  161. /* 61 */    NO_CONVERSION,                    \
  162. /* 62 */    NO_CONVERSION,                    \
  163. /* 63 */    NO_CONVERSION,                    \
  164. /* 64 */    NO_CONVERSION,                    \
  165. /* 65 */    NO_CONVERSION,                    \
  166. /* 66 */    NO_CONVERSION,                    \
  167. /* 67 */    NO_CONVERSION,                    \
  168. /* 68 */    NO_CONVERSION,                    \
  169. /* 69 */    NO_CONVERSION,                    \
  170. /* 70 */    NO_CONVERSION,                    \
  171. /* 71 */    NO_CONVERSION,                    \
  172. /* 72 */    NO_CONVERSION,                    \
  173. /* 73 */    NO_CONVERSION,                    \
  174. /* 74 */    META_SLASH,                    \
  175. /* 75 */    NO_CONVERSION,                    \
  176. /* 76 */    NO_CONVERSION,                    \
  177. /* 77 */    NO_CONVERSION,                    \
  178. /* 78 */    NO_CONVERSION,                    \
  179. /* 79 */    NO_CONVERSION,                    \
  180. /* 80 */    NO_CONVERSION,                    \
  181. /* 81 */    NO_CONVERSION,                    \
  182. /* 82 */    NO_CONVERSION,                    \
  183. /* 83 */    NO_CONVERSION,                    \
  184. /* 84 */    NO_CONVERSION,                    \
  185. /* 85 */    NO_CONVERSION,                    \
  186. /* 86 */    NO_CONVERSION,                    \
  187. /* 87 */    NO_CONVERSION,                    \
  188. /* 88 */    NO_CONVERSION,                    \
  189. /* 89 */    NO_CONVERSION,                    \
  190. /* 90 */    NO_CONVERSION,                    \
  191. /* 91 */    NO_CONVERSION,                    \
  192. /* 92 */    NO_CONVERSION,                    \
  193. /* 93 */    NO_CONVERSION,                    \
  194. /* 94 */    NO_CONVERSION,                    \
  195. /* 95 */    NO_CONVERSION,                    \
  196. /* 96 */    NO_CONVERSION,                    \
  197. /* 97 */    NO_CONVERSION,                    \
  198. /* 98 */    NO_CONVERSION,                    \
  199. /* 99 */    NO_CONVERSION,                    \
  200. /* 100 */    NO_CONVERSION,                    \
  201. /* 101 */    NO_CONVERSION,                    \
  202. /* 102 */    NO_CONVERSION,                    \
  203. /* 103 */    NO_CONVERSION,                    \
  204. /* 104 */    NO_CONVERSION,                    \
  205. /* 105 */    NO_CONVERSION,                    \
  206. /* 106 */    NO_CONVERSION,                    \
  207. /* 107 */    NO_CONVERSION,                    \
  208. /* 108 */    NO_CONVERSION,                    \
  209. /* 109 */    NO_CONVERSION,                    \
  210. /* 110 */    NO_CONVERSION,                    \
  211. /* 111 */    NO_CONVERSION,                    \
  212. /* 112 */    NO_CONVERSION,                    \
  213. /* 113 */    NO_CONVERSION,                    \
  214. /* 114 */    NO_CONVERSION,                    \
  215. /* 115 */    NO_CONVERSION,                    \
  216. /* 116 */    NO_CONVERSION,                    \
  217. /* 117 */    NO_CONVERSION,                    \
  218. /* 118 */    NO_CONVERSION,                    \
  219. /* 119 */    NO_CONVERSION,                    \
  220. /* 120 */    META_1,                        \
  221. /* 121 */    META_2,                        \
  222. /* 122 */    META_3,                        \
  223. /* 123 */    META_4,                        \
  224. /* 124 */    META_5,                        \
  225. /* 125 */    META_6,                        \
  226. /* 126 */    META_7,                        \
  227. /* 127 */    META_8,                        \
  228. /* 128 */    META_9,                        \
  229. /* 129 */    META_0,                        \
  230. /* 130 */    META_DASH,                    \
  231. /* 131 */    META_EQUAL,                    \
  232. /* 132 */    NO_CONVERSION,                    \
  233. /* 133 */    NO_CONVERSION,                    \
  234. /* 134 */    NO_CONVERSION,                    \
  235. /* 135 */    NO_CONVERSION,                    \
  236. /* 136 */    NO_CONVERSION,                    \
  237. /* 137 */    NO_CONVERSION,                    \
  238. /* 138 */    NO_CONVERSION,                    \
  239. /* 139 */    NO_CONVERSION,                    \
  240. /* 140 */    NO_CONVERSION,                    \
  241. /* 141 */    NO_CONVERSION,                    \
  242. /* 142 */    NO_CONVERSION,                    \
  243. /* 143 */    NO_CONVERSION,                    \
  244. /* 144 */    NO_CONVERSION,                    \
  245. /* 145 */    NO_CONVERSION,                    \
  246. /* 146 */    NO_CONVERSION,                    \
  247. /* 147 */    NO_CONVERSION,                    \
  248. /* 148 */    NO_CONVERSION,                    \
  249. /* 149 */    NO_CONVERSION,                    \
  250. /* 150 */    NO_CONVERSION,                    \
  251. /* 151 */    NO_CONVERSION,                    \
  252. /* 152 */    NO_CONVERSION,                    \
  253. /* 153 */    NO_CONVERSION,                    \
  254. /* 154 */    NO_CONVERSION,                    \
  255. /* 155 */    NO_CONVERSION,                    \
  256. /* 156 */    NO_CONVERSION,                    \
  257. /* 157 */    NO_CONVERSION,                    \
  258. /* 158 */    NO_CONVERSION,                    \
  259. /* 159 */    NO_CONVERSION,                    \
  260. /* 160 */    NO_CONVERSION,                    \
  261. /* 161 */    NO_CONVERSION,                    \
  262. /* 162 */    NO_CONVERSION,                    \
  263. /* 163 */    NO_CONVERSION,                    \
  264. /* 164 */    META_DASH,                    \
  265. /* 165 */    META_TAB,                    \
  266. /* 166 */    META_RET,                    \
  267. /* 167 */    NO_CONVERSION,                    \
  268. /* 168 */    NO_CONVERSION,                    \
  269. /* 169 */    NO_CONVERSION,                    \
  270. /* 170 */    NO_CONVERSION,                    \
  271. /* 171 */    NO_CONVERSION,                    \
  272. /* 172 */    NO_CONVERSION,                    \
  273. /* 173 */    NO_CONVERSION,                    \
  274. /* 174 */    NO_CONVERSION,                    \
  275. /* 175 */    NO_CONVERSION,                    \
  276. /* 176 */    NO_CONVERSION,                    \
  277. /* 177 */    NO_CONVERSION,                    \
  278. /* 178 */    NO_CONVERSION,                    \
  279. /* 179 */    NO_CONVERSION,                    \
  280. /* 180 */    NO_CONVERSION,                    \
  281. /* 181 */    NO_CONVERSION,                    \
  282. /* 182 */    NO_CONVERSION,                    \
  283. /* 183 */    NO_CONVERSION,                    \
  284. /* 184 */    NO_CONVERSION,                    \
  285. /* 185 */    NO_CONVERSION,                    \
  286. /* 186 */    NO_CONVERSION,                    \
  287. /* 187 */    NO_CONVERSION,                    \
  288. /* 188 */    NO_CONVERSION,                    \
  289. /* 189 */    NO_CONVERSION,                    \
  290. /* 190 */    NO_CONVERSION,                    \
  291. /* 191 */    NO_CONVERSION,                    \
  292. /* 192 */    NO_CONVERSION,                    \
  293. /* 193 */    NO_CONVERSION,                    \
  294. /* 194 */    NO_CONVERSION,                    \
  295. /* 195 */    NO_CONVERSION,                    \
  296. /* 196 */    NO_CONVERSION,                    \
  297. /* 197 */    NO_CONVERSION,                    \
  298. /* 198 */    NO_CONVERSION,                    \
  299. /* 199 */    NO_CONVERSION,                    \
  300. /* 200 */    NO_CONVERSION,                    \
  301. /* 201 */    NO_CONVERSION,                    \
  302. /* 202 */    NO_CONVERSION,                    \
  303. /* 203 */    NO_CONVERSION,                    \
  304. /* 204 */    NO_CONVERSION,                    \
  305. /* 205 */    NO_CONVERSION,                    \
  306. /* 206 */    NO_CONVERSION,                    \
  307. /* 207 */    NO_CONVERSION,                    \
  308. /* 208 */    NO_CONVERSION,                    \
  309. /* 209 */    NO_CONVERSION,                    \
  310. /* 210 */    NO_CONVERSION,                    \
  311. /* 211 */    NO_CONVERSION,                    \
  312. /* 212 */    NO_CONVERSION,                    \
  313. /* 213 */    NO_CONVERSION,                    \
  314. /* 214 */    NO_CONVERSION,                    \
  315. /* 215 */    NO_CONVERSION,                    \
  316. /* 216 */    NO_CONVERSION,                    \
  317. /* 217 */    NO_CONVERSION,                    \
  318. /* 218 */    NO_CONVERSION,                    \
  319. /* 219 */    NO_CONVERSION,                    \
  320. /* 220 */    NO_CONVERSION,                    \
  321. /* 221 */    NO_CONVERSION,                    \
  322. /* 222 */    NO_CONVERSION,                    \
  323. /* 223 */    NO_CONVERSION,                    \
  324. /* 224 */    NO_CONVERSION,                    \
  325. /* 225 */    NO_CONVERSION,                    \
  326. /* 226 */    NO_CONVERSION,                    \
  327. /* 227 */    NO_CONVERSION,                    \
  328. /* 228 */    NO_CONVERSION,                    \
  329. /* 229 */    NO_CONVERSION,                    \
  330. /* 230 */    NO_CONVERSION,                    \
  331. /* 231 */    NO_CONVERSION,                    \
  332. /* 232 */    NO_CONVERSION,                    \
  333. /* 233 */    NO_CONVERSION,                    \
  334. /* 234 */    NO_CONVERSION,                    \
  335. /* 235 */    NO_CONVERSION,                    \
  336. /* 236 */    NO_CONVERSION,                    \
  337. /* 237 */    NO_CONVERSION,                    \
  338. /* 238 */    NO_CONVERSION,                    \
  339. /* 239 */    NO_CONVERSION,                    \
  340. /* 240 */    NO_CONVERSION,                    \
  341. /* 241 */    NO_CONVERSION,                    \
  342. /* 242 */    NO_CONVERSION,                    \
  343. /* 243 */    NO_CONVERSION,                    \
  344. /* 244 */    NO_CONVERSION,                    \
  345. /* 245 */    NO_CONVERSION,                    \
  346. /* 246 */    NO_CONVERSION,                    \
  347. /* 247 */    NO_CONVERSION,                    \
  348. /* 248 */    NO_CONVERSION,                    \
  349. /* 249 */    NO_CONVERSION,                    \
  350. /* 250 */    NO_CONVERSION,                    \
  351. /* 251 */    NO_CONVERSION,                    \
  352. /* 252 */    NO_CONVERSION,                    \
  353. /* 253 */    NO_CONVERSION,                    \
  354. /* 254 */    NO_CONVERSION,                    \
  355. /* 255 */    NO_CONVERSION                    \
  356. }
  357.  
  358. #define KEYBOARD_SCANCODE_TABLE_SIZE    (256)
  359. #endif
  360.